package com.zj.jdbc2ThreadLocal;

import com.zj.bean.UserInfo;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

/**
 * service抛出异常，使用代理类来处理事务
 */
public class JdbcService2 {


    public List<UserInfo> doBusiness(UserInfo user,int id) throws SQLException {
        List<UserInfo> all=new ArrayList<>();
            UserDaoImpl userDao=SingletonEnum.INSTANCE.getUserDao();
            userDao.update(user,id);
            all = userDao.getAll();
            int a=1/0;
            return all;


    }
}
